package com.copy.pojo;

import com.copy.parse.transform.TypeTransform;

import java.lang.reflect.Method;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
 * author: liziyun
 * date: 2019-9-30
 * email: root@ofo.email
 * describe: 方法元数据信息
 *      存储属性的映射关系 和 类型转换器
 */
public class BeanMethod {
    private Method method;
    private Class resourceClass;
    private Class targetClass;
    //已经提前实例化目标对象
    private boolean eagerInstance=false;
    //是否使用@Params注解
    private boolean openParam;
    //是否启动@Clone注解
    private boolean clone = false;

    //key: 目标属性的名称
    private Map<String,Property> propertyMapping = new ConcurrentHashMap();

    public BeanMethod(Method method) {
        this.method = method;
    }

    public boolean isEagerInstance() {
        return eagerInstance;
    }

    public void setEagerInstance(boolean eagerInstance) {
        this.eagerInstance = eagerInstance;
    }

    public Map<String, Property> getPropertyMapping() {
        return propertyMapping;
    }

    public void setPropertyMapping(String key, Property value) {
        propertyMapping.put(key,value);
    }



    public boolean isOpenParam() {
        return openParam;
    }

    public void setOpenParam(boolean openParam) {
        this.openParam = openParam;
    }

    public Method getMethod() {
        return method;
    }

    public boolean isClone() {
        return clone;
    }

    public void setClone(boolean clone) {
        this.clone = clone;
    }
}
